
package com.mycompany.j2eem.Entity;

import static java.lang.Thread.sleep;

/**
 *
 * @author wucy
 */
public class MyThread implements Runnable {

    private java.lang.Thread t;
    private String threadName;
    private int num;

    public MyThread(String name) {
        threadName = name;
        num = Integer.parseInt(name);
    }

    public void run() {
        try {
            sleep(1000);
        } catch (InterruptedException ex) {
        }
        System.out.println(num);
      
    }

    public void start() {
        if (t == null) {
            t = new java.lang.Thread(this, threadName);
            t.start();
        }
    }
}

